import React, { Component } from 'react';
import { connect } from 'react-redux';
import {
    HotItem,
    HotWapper
} from '../style';

class Hot extends Component {
    render() {
        return (
            <HotWapper>
                {
                    this.props.list.map((item) => {
                        return (
                            <HotItem key={item.get('id')}>
                                <img className="hot-img"  alt="" src={item.get('imgUrl')}/>
                                <div className="hot-title">{item.get('title')}</div>
                            </HotItem>
                        )
                    })
                }
            </HotWapper>
        );
    }
}

const mapStateToProps = (state) => {
    return {
        list: state.get('home').get('hotList'),
    }
}
export default connect(mapStateToProps, null)(Hot);